<!--
 * @Date         : 2024-03-01 20:29:20
 * @LastEditTime : 2024-03-09 16:11:15
 * @description  : 
-->
<script setup>
import { getExamInfo, getPrescription } from "@/api";
import router from "@/router";
import { onMounted } from "vue";
import Header from "../components/Header.vue";
const list = ref([]);

const getData = () => {
  getPrescription().then((res) => {
    list.value = res.data;
  });
};

const onClickPractice = (value) => {
  router.push({
    path: "/practice",
    query: {
      id: value.id,
    },
  });
};
const onLog = (value) => {
  router.push({
    path: "/trainLog",
    query: {
      id: value.id,
    },
  });
};

onMounted(() => {
  getData();
});
</script>

<template>
  <div class="Notice">
    <Header title="中药处方审核练习" :isHideRight="false" />
    <div class="main">
      <div class="list" v-for="(item, index) in list" :key="item.id">
        <div class="title">{{ item.title }}</div>
        <div class="list-row">
          <div class="text">题数：{{ item.num }}题</div>
          <div class="text">考试时长：15分钟</div>
          <div class="text">总分：{{ item.all_score }}分</div>
          <div>
            <el-button
              type="primary"
              color="#855c4c"
              @click="onClickPractice(item)"
            >
              开始练习
            </el-button>
            <el-button color="#855c4c" @click="onLog(item)">
              练习记录
            </el-button>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<style lang="scss" scoped>
.Notice {
  background: #855c4c;
  box-sizing: border-box;
  height: 100vh;
  overflow: auto;
  .main {
    overflow-y: auto;
    margin: 0 10px 10px 10px;
    background: #f6eee8;
    box-sizing: border-box;
    height: 88vh;
    padding: 20px 40px;
    .list {
      border-bottom: 2px dashed #855c4c;
      padding: 20px 0;
      .title {
        color: #652e1b;
        font-size: 16px;
        font-weight: 600;
      }
      .list-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        color: #666666;
      }
    }
  }
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
  background-color: #f5f5f5;
  border-radius: 5px;
}

/* 设置滚动条滑块的背景色和圆角 */
::-webkit-scrollbar-thumb {
  background-color: #ccc;
  border-radius: 5px;
}

/* 设置滚动条滑块在悬停状态下的背景色和圆角 */
::-webkit-scrollbar-thumb:hover {
  background-color: #999;
  border-radius: 5px;
}

/* 设置滚动条轨道的背景色和圆角 */
::-webkit-scrollbar-track {
  background-color: #652e1b;
  border-radius: 5px;
}

/* 设置滚动条轨道在悬停状态下的背景色和圆角 */
::-webkit-scrollbar-track:hover {
  background-color: #ccc;
  border-radius: 5px;
}
</style>
